import java.time.DayOfWeek;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;

public class test {
    public static void main(String[] args) {
        LocalDateTime today = LocalDateTime.now();
        int currentYear = today.getYear();

        System.out.println("今年的考试时间如下：");
        for (int month = 1; month <= 12; month++) {
            // 获取当前年月的第一天
            LocalDateTime firstDayOfMonth = LocalDateTime.of(currentYear, month, 1, 0, 0);
            // 找到该月的最后一个周六
            LocalDateTime lastSaturday = firstDayOfMonth.with(TemporalAdjusters.lastInMonth(DayOfWeek.SATURDAY));
            // 如果这个周六是该月的最后一天，则向前推一周
            if (lastSaturday.toLocalDate().equals(firstDayOfMonth.toLocalDate().plusMonths(1).minusDays(1))) {
                lastSaturday = lastSaturday.minusWeeks(1);
            }
            // 找到倒数第二个周六
            LocalDateTime secondLastSaturday = lastSaturday.minusWeeks(1);
            // 设置时间为上午8点
            LocalDateTime examTime = secondLastSaturday.withHour(8).withMinute(0);
            // 格式化输出
            String formattedDate = examTime.format(DateTimeFormatter.ofPattern("yyyy/MM/dd hh"));
            System.out.println(formattedDate);
        }
    }
}